import os
from app import create_app, db
from app.models.user import User

# 根据环境变量加载不同配置
app = create_app(os.getenv('FLASK_ENV', 'development'))  # 默认使用开发环境配置

# 只在开发环境自动创建表
if os.getenv('FLASK_ENV') == 'development' or app.config['DEBUG']:
    with app.app_context():
        db.create_all()

if __name__ == '__main__':
    app.run(host='0.0.0.0',port=5000, debug=False) 

